-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use AbstractCloudSlave and AbstractCloudComputer #1015
base: master
Are you sure you want to change the base?
Conversation
@@ -456,7 +458,8 @@ public void terminate() { | |||
Jenkins.get().removeNode(this); | |||
LOGGER.info("Removed EC2 instance from jenkins controller: " + getInstanceId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these INFO
log messages could probably be replaced with messages to the TaskListener
.
@@ -196,7 +198,8 @@ public void terminate() { | |||
LOGGER.info("Cancelled Spot request: " + spotInstanceRequestId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto here
} | ||
} | ||
} | ||
} catch (Exception e) { | ||
LOGGER.log(Level.WARNING, "Failed to remove agent: ", e); | ||
Functions.printStackTrace(e, listener.error("Failed to remove agent")); | ||
} finally { | ||
// Remove the instance even if deletion failed, otherwise it will hang around forever in | ||
// the nodes page. One way for this to occur is that an instance was terminated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pay attention to https://github.com/jenkinsci/jenkins/blob/4248fc0ca6ce108364ed23208063ff20753f5e70/core/src/main/java/hudson/slaves/AbstractCloudSlave.java#L88-L94 which means that after switching fromterminate
to _terminate
it is no longer your responsibility to removeNode
.
@@ -456,7 +458,8 @@ public void terminate() { | |||
Jenkins.get().removeNode(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto here
@@ -178,7 +180,7 @@ protected boolean isAlive(boolean force) { | |||
* Cancel the spot request for the instance. Terminate the instance if it is up. Remove the agent from Jenkins. | |||
*/ | |||
@Override | |||
public void terminate() { | |||
protected void _terminate(TaskListener listener) throws IOException, InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impl seems mostly the same as in EC2OndemandSlave
. Is there a reason the method cannot simply be pulled up into EC2AbstractSlave
.
supersedes #998
Testing done
Submitter checklist